
abstract class  AbstractProductA {
   abstract methodA():void;
   abstract methodB():void;
}

abstract class AbstractProductB
{
    abstract methodA():void;
    abstract methodB();void;
}

class ProductA extends AbstractProductA
{
    methodA(): void {
        
    }
    methodB(): void {
        
    }
    constructor(value: string)
    {
        super();
        console.log(value);
    }   
}
class ProductB extends AbstractProductB
{
    methodA(): void {
     
    }
    methodB() {
    }
    constructor(value: string)
    {
        super();
        console.log(value);
    }
}

abstract class AbstractFactory
{
    abstract creatProductA():AbstractProductA;
    abstract creatProductB():AbstractProductB;
}

class NewYoryFactory extends AbstractFactory
{
    creatProductA(): AbstractProductA {
     return new ProductA("creat product in New York A method");
    }
    creatProductB(): AbstractProductB {
       return new ProductB("creat product in New York B method");
    }
}
class ShenzhenFactory extends AbstractFactory
{
    creatProductA(): AbstractProductA {
       return new ProductA("creat product in Shenzhen A method");
    }
    creatProductB(): AbstractProductB {
       return new ProductB("creact product in shenzhen B mehtod");
    }
}
function main()
{
  const newYorkFactory = new NewYoryFactory();
  newYorkFactory.creatProductA();
  newYorkFactory.creatProductB();

  const shenzhenFactory = new ShenzhenFactory();
  shenzhenFactory.creatProductA();
  shenzhenFactory.creatProductB();
}
export class AbstractFactoryAction
{
    public test():void
    {
        main(); 
    }
}

